############################################
# copy over users.yml
users_yml = IO.read(File.join(File.dirname(__FILE__), '/test/fixtures/users.yml'))
new_users_yml_file_path = File.expand_path(File.join(File.dirname(__FILE__), '../../../test/fixtures/users.yml'))
if File.exists?(new_users_yml_file_path)
    puts '** users.yml already exists in the /test/fixtures directory.  Feel free to copy the contents of vendor/plugins/account/test/fixtures/users.yml into this file so that you can use the contents in your tests.'
else
    File.open(new_users_yml_file_path, 'w+') do |file|
        file.print(users_yml)
    end
end

############################################
# copy over salt
salt = IO.read(File.join(File.dirname(__FILE__), '/config/salt.rb'))
salt_file_path = File.expand_path(File.join(File.dirname(__FILE__), '../../../config/salt.rb'))
if !File.exists?(salt_file_path)
    File.open(salt_file_path, 'w+') do |file|
        file.print(salt)
    end
else
    puts '** salt.rb already exists in the /config directory.  Please ensure that your salt file is properly configured for the account plugin.  Look at /vendor/plugins/account/config/salt.rb for an example.'
end

############################################
# copy over account configuration
config = IO.read(File.join(File.dirname(__FILE__), '/config/account_config.rb'))
config_file_path = File.expand_path(File.join(File.dirname(__FILE__), '../../../config/account_config.rb'))
if !File.exists?(config_file_path)
    File.open(config_file_path, 'w+') do |file|
        file.print(config)
    end
else
    puts '** account_config.rb already exists in the /config directory.  Please ensure that your salt file is properly configured for the account plugin.  Look at /vendor/plugins/account/config/account_config.rb for an example.'
end


# output readme
puts '*******************************************************'
puts IO.read(File.join(File.dirname(__FILE__), 'README'))